<%--                                                                       --%>
<%-- Copyright (c) 2003-2005 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%
  String ctxPath = request.getContextPath();
%>

<script language="JavaScript">

  function doViewTaskAction(tasknumber) {
    document.processStepsForm.number.value = tasknumber;
    document.processStepsForm.action = '<c:url value="/bp/processTaskView.do"/>';
    document.processStepsForm.submit();
  }

  function doEditTaskAction(tasknumber) {
    document.processStepsForm.number.value = tasknumber;
    document.processStepsForm.action = '<c:url value="/bp/processTaskEdit.do"/>';
    document.processStepsForm.submit();
  }

</script>
  
<% 
  java.util.HashMap map = new java.util.HashMap();
  String procOid = request.getParameter("processOid"); 
  if (procOid != null && procOid.length() > 0) {
    map.put("processOid", procOid);
  }
  else {
    map.put("processOid", "-1");
  }
  pageContext.setAttribute("pagetabParam", map, PageContext.PAGE_SCOPE);
%>

<c:set var="editImg">
<img src="<%= ctxPath %>/mc/images/action/icon_edit.gif" width="15" height="15" border="0" class="actionIcon" alt="<bean-el:message key="image.alt.edit" bundle="mc.messages"/>" title="<bean-el:message key="image.alt.edit" bundle="mc.messages"/>">
</c:set>

<html-el:form action="/bp/processSteps.do">
<html-el:hidden name="processStepsForm" property="processOid"/>
<input type="hidden" name="number"/>
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle"><c:out value="${processStepsView.map.name}"/></div>
      <div class="errorMessage"><html-el:errors bundle="bp.messages"/></div>
      <%@include file="/mc/common/pagetab.jsp" %>
      <logic:present name="processSubprocessPath" scope="session">
        <logic:greaterThan name="processSubprocessPath" property="processOid" value="0">
          <div class="breadcrumb">
            <html-el:link page="/bp/processSubprocessView.do" paramId="processOid" paramName="processSubprocessPath" paramProperty="processOid">
              <c:out value="${processSubprocessPath.map.processName}"/>
            </html-el:link>
            <logic:iterate id="subprocess" name="processSubprocessPath" property="subprocesses" indexId="i">
              &nbsp;<bean-el:message key="bp.process.taskSeparator" bundle="bp.messages"/>&nbsp;
              <logic:equal name="subprocess" property="lastone" value="false">
                <html-el:link page="/bp/processSubprocessTaskView.do" name="subprocess" property="parameterTaskMap">
                  <c:out value="${subprocess.map.number}"/>:
                  <c:out value="${subprocess.map.friendlyName}"/>
                </html-el:link>
                &nbsp;<bean-el:message key="bp.process.taskSeparator" bundle="bp.messages"/>&nbsp;
                <html-el:link page="/bp/processSubprocessView.do" name="subprocess" property="parameterMap">
                  <c:out value="${subprocess.map.subprocessName}"/>
                </html-el:link>
              </logic:equal>
              <logic:equal name="subprocess" property="lastone" value="true">
                <html-el:link page="/bp/processSubprocessTaskView.do" name="subprocess" property="parameterTaskMap">
                  <c:out value="${subprocess.map.number}"/>:
                  <c:out value="${subprocess.map.friendlyName}"/>
                </html-el:link>
                &nbsp;<bean-el:message key="bp.process.taskSeparator" bundle="bp.messages"/>&nbsp;
                <c:out value="${subprocess.map.subprocessName}"/>
              </logic:equal>
            </logic:iterate>
          </div>
        </logic:greaterThan>
      </logic:present>
      <div class="pageSubtitle">
        <span class="left"><bean-el:message key="bp.process.processSteps.list" bundle="bp.messages"/></span>
        <span class="right">&nbsp;</span>
      </div>
        <table class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="items list table" width="100%">
          <logic:empty name="processStepsView" property="steps">
            <tr class="listEven">
              <td align="center" colspan="2">
                <bean-el:message key="bp.process.processSteps.noStep" bundle="bp.messages"/>
              </td>
            </tr>
          </logic:empty>
          <logic:notEmpty name="processStepsView" property="steps">
            <logic:iterate id="step" name="processStepsView" property="steps" indexId="i">
              <tr class="<%=i.intValue() % 2 == 0 ? "listEven" : "listOdd" %>">
                <td style="text-indent:0px" width="90%">
                  <logic:equal name="step" property="type" value="0">
                    <img src="<%= ctxPath %>/bp/images/icons/flow.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.webflow" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.webflow" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="1">
                    <img src="<%= ctxPath %>/bp/images/icons/aa.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.aa" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.aa" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="2">
                    <img src="<%= ctxPath %>/bp/images/icons/manual.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.manual" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.manual" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="3">
                    <img src="<%= ctxPath %>/bp/images/icons/milestone.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.milestone" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.milestone" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="4">
                    <img src="<%= ctxPath %>/bp/images/icons/beginning.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.start" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.start" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="5">
                    <img src="<%= ctxPath %>/bp/images/icons/ending.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.end" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.end" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="6">
                    <img src="<%= ctxPath %>/bp/images/icons/subprocess.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.subworkflow" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.subworkflow" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="7">
                    <img src="<%= ctxPath %>/bp/images/icons/notification.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.notification" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.notification" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="8">
                    <img src="<%= ctxPath %>/bp/images/icons/cabinet.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.cabinet" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.cabinet" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="9">
                    <img src="<%= ctxPath %>/bp/images/icons/collaboration.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.collaboration" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.collaboration" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="10">
                    <img src="<%= ctxPath %>/bp/images/icons/policy.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.policy" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.policy" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="11">
                    <img src="<%= ctxPath %>/bp/images/icons/form.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.form" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.form" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="12">
                    <img src="<%= ctxPath %>/bp/images/icons/timing.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.timing" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.timing" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="13">
                    <img src="<%= ctxPath %>/bp/images/icons/decision.gif" border="0" alt="<bean-el:message key="bp.process.processSteps.taskType.decision" bundle="bp.messages"/>" title="<bean-el:message key="bp.process.processSteps.taskType.decision" bundle="bp.messages"/>" align="adsmiddle">
                  </logic:equal>
                  <logic:equal name="step" property="type" value="4">
                    <c:out value="${step.map.friendlyName}"/>
                  </logic:equal>
                  <logic:equal name="step" property="type" value="5">
                    <c:out value="${step.map.friendlyName}"/>
                  </logic:equal>
                  <logic:notEqual name="step" property="type" value="4">
                    <logic:notEqual name="step" property="type" value="5">                  
                      <c:out value="${step.map.number}"/>:
                      <a href='#' onclick="doViewTaskAction('<c:out value="${step.map.number}"/>');">
                        <c:out value="${step.map.friendlyName}"/></a>
                    </logic:notEqual> 
                  </logic:notEqual> 
                </td>
                <td nowrap align="left" width="10%">
                  <logic:equal name="step" property="type" value="4">
                    &nbsp;
                  </logic:equal>
                  <logic:equal name="step" property="type" value="5">
                    &nbsp;
                  </logic:equal>
                  <logic:notEqual name="step" property="type" value="4">
                    <logic:notEqual name="step" property="type" value="5">                  
                      <a href='#' onclick="doEditTaskAction('<c:out value="${step.map.number}"/>');"><c:out value='${editImg}' escapeXml="false"/></a>
                    </logic:notEqual> 
                  </logic:notEqual> 
                </td>
              </tr>
            </logic:iterate>
          </logic:notEmpty>
        </table>
    </td>
  </tr>
</table>
</html-el:form>

